package com.validate;

import com.dto.CellValidateResult;
import com.dto.RowValidateResult;
import com.filter.AbstractValidator;
import com.helper.Student;

public class ChckeUid extends AbstractValidator<RowValidateResult, Student> {
    @Override
    protected RowValidateResult validate(Student dto) {
        RowValidateResult row = null;
        if (!checkId(dto)){
            row=new RowValidateResult();
            row.setIndex(dto.getIndex());
            row.setRows(new CellValidateResult("身份证位数不对"));
        }
        return row;
    }
    private boolean checkId(Student dto){
        if (dto.getUid().length()!=18){
            return false;
        }
        return true;
    }
}
